/*******************************************************************************
 * Copyright (c) 2010 Mikhail Garber.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License (LGPL)
 * which accompanies this distribution
 * 
 * Contributors:
 *     Mikhail Garber - initial API and implementation
 ******************************************************************************/
package plumber.model;

/**
 * subclass of Class-based Outcome, this Outcome will match if particular 
 * Exception was thrown by Step execution
 * @author mgarber
 *
 */
@SuppressWarnings("serial")
public class ExceptionOutcome extends ClassBasedOutcome {

	
	/* (non-Javadoc)
	 * @see plumber.model.ClassBasedOutcome#validateImpl()
	 */
	@Override
	public void validateImpl() {		
		super.validateImpl();
		if(! Exception.class.isAssignableFrom(this.getTriggerClass())) {
			throw new IllegalStateException("trigger class is not an exception");
		}
	}


}
